package com.kuhyygy.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.kuhyygy.R;

public class LoginActivity extends BaseActivity {

	private Button btn;
	private EditText userEt;
	private EditText passEt;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.loginform);
		btn = (Button) this.findViewById(R.id.loginBtn);
		userEt = (EditText) this.findViewById(R.id.loginUser);
		passEt = (EditText) this.findViewById(R.id.loginPass);
		btn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				if ("root".equals(userEt.getText().toString())
						&& "123456".equals(passEt.getText().toString())) {
					Intent i = new Intent(LoginActivity.this, ForceOffLineActivity.class);
					startActivity(i);
				} else {
					Toast.makeText(LoginActivity.this, "无效用户名密码", Toast.LENGTH_SHORT).show();
				}
			}
		});
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}

}
